3.45 \(\int \sin (e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=54 \[ -\frac{(a-b)^2 \cos (e+f x)}{f}+\frac{2 b (a-b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]

[Out]

-(((a - b)^2*Cos[e + f*x])/f) + (2*(a - b)*b*Sec[e + f*x])/f + (b^2*Sec[e + f*x]^3)/(3*f)

________________________________________________________________________________________

Rubi [A]  time = 0.045866, antiderivative size = 54, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3664, 270} \[ -\frac{(a-b)^2 \cos (e+f x)}{f}+\frac{2 b (a-b) \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[Sin[e + f*x]*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

-(((a - b)^2*Cos[e + f*x])/f) + (2*(a - b)*b*Sec[e + f*x])/f + (b^2*Sec[e + f*x]^3)/(3*f)

Rule 3664

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[((-1 + ff^2*x^2)^((m - 1)/2)*(a - b + b*ff^2*x^2)^p)/x^(
m + 1), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rubi steps

\begin{align*} \int \sin (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a-b+b x^2\right )^2}{x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (2 (a-b) b+\frac{(a-b)^2}{x^2}+b^2 x^2\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac{(a-b)^2 \cos (e+f x)}{f}+\frac{2 (a-b) b \sec (e+f x)}{f}+\frac{b^2 \sec ^3(e+f x)}{3 f}\\ \end{align*}

Mathematica [A]  time = 0.289056, size = 48, normalized size = 0.89 \[ \frac{b \sec (e+f x) \left (6 a+b \sec ^2(e+f x)-6 b\right )-3 (a-b)^2 \cos (e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[e + f*x]*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(-3*(a - b)^2*Cos[e + f*x] + b*Sec[e + f*x]*(6*a - 6*b + b*Sec[e + f*x]^2))/(3*f)

________________________________________________________________________________________

Maple [B]  time = 0.049, size = 125, normalized size = 2.3 \begin{align*}{\frac{1}{f} \left ( -{a}^{2}\cos \left ( fx+e \right ) +2\,ab \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{4}}{\cos \left ( fx+e \right ) }}+ \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) \right ) +{b}^{2} \left ({\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{3\, \left ( \cos \left ( fx+e \right ) \right ) ^{3}}}-{\frac{ \left ( \sin \left ( fx+e \right ) \right ) ^{6}}{\cos \left ( fx+e \right ) }}- \left ({\frac{8}{3}}+ \left ( \sin \left ( fx+e \right ) \right ) ^{4}+{\frac{4\, \left ( \sin \left ( fx+e \right ) \right ) ^{2}}{3}} \right ) \cos \left ( fx+e \right ) \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(f*x+e)*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/f*(-a^2*cos(f*x+e)+2*a*b*(sin(f*x+e)^4/cos(f*x+e)+(2+sin(f*x+e)^2)*cos(f*x+e))+b^2*(1/3*sin(f*x+e)^6/cos(f*x
+e)^3-sin(f*x+e)^6/cos(f*x+e)-(8/3+sin(f*x+e)^4+4/3*sin(f*x+e)^2)*cos(f*x+e)))

________________________________________________________________________________________

Maxima [A]  time = 0.979617, size = 96, normalized size = 1.78 \begin{align*} \frac{6 \, a b{\left (\frac{1}{\cos \left (f x + e\right )} + \cos \left (f x + e\right )\right )} - b^{2}{\left (\frac{6 \, \cos \left (f x + e\right )^{2} - 1}{\cos \left (f x + e\right )^{3}} + 3 \, \cos \left (f x + e\right )\right )} - 3 \, a^{2} \cos \left (f x + e\right )}{3 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/3*(6*a*b*(1/cos(f*x + e) + cos(f*x + e)) - b^2*((6*cos(f*x + e)^2 - 1)/cos(f*x + e)^3 + 3*cos(f*x + e)) - 3*
a^2*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.96447, size = 136, normalized size = 2.52 \begin{align*} -\frac{3 \,{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 6 \,{\left (a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/3*(3*(a^2 - 2*a*b + b^2)*cos(f*x + e)^4 - 6*(a*b - b^2)*cos(f*x + e)^2 - b^2)/(f*cos(f*x + e)^3)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Integral((a + b*tan(e + f*x)**2)**2*sin(e + f*x), x)

________________________________________________________________________________________

Giac [A]  time = 1.76229, size = 127, normalized size = 2.35 \begin{align*} -\frac{a^{2} f^{3} \cos \left (f x + e\right ) - 2 \, a b f^{3} \cos \left (f x + e\right ) + b^{2} f^{3} \cos \left (f x + e\right )}{f^{4}} + \frac{6 \, a b \cos \left (f x + e\right )^{2} - 6 \, b^{2} \cos \left (f x + e\right )^{2} + b^{2}}{3 \, f \cos \left (f x + e\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-(a^2*f^3*cos(f*x + e) - 2*a*b*f^3*cos(f*x + e) + b^2*f^3*cos(f*x + e))/f^4 + 1/3*(6*a*b*cos(f*x + e)^2 - 6*b^
2*cos(f*x + e)^2 + b^2)/(f*cos(f*x + e)^3)